package com.J.OpenGLSample;



import android.app.Activity;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.view.WindowManager;

public class glActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                WindowManager.LayoutParams.FLAG_FULLSCREEN);        
        
        mGLView = new GLSurfaceView(this);
        mGLView.setEGLConfigChooser(false);
        mQuad = new QuadRenderer(this);
        mGLView.setRenderer(mQuad);
        mGLView.setOnTouchListener(mQuad);
        setContentView(mGLView);
        
		SensorManager sm = (SensorManager)getSystemService(SENSOR_SERVICE);		
//		sm.registerListener (mQuad, sm.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_NORMAL);
		sm.registerListener (mQuad, sm.getDefaultSensor(Sensor.TYPE_ORIENTATION), SensorManager.SENSOR_DELAY_NORMAL);
    }

    @Override
    protected void onPause() {
        super.onPause();
        mGLView.onPause();
    }

    @Override
    protected void onResume() {
        super.onResume();
        mGLView.onResume();
    }

    private GLSurfaceView mGLView;
    private QuadRenderer mQuad;
}